/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sk.adresa.eaukcia.core.service.impl;

import sk.adresa.eaukcia.core.dao.AuctionDao;
import sk.adresa.eaukcia.core.data.Auction;
import sk.adresa.eaukcia.core.data.filter.AuctionFilter;
import sk.adresa.eaukcia.core.query.PaginatedList;
import sk.adresa.eaukcia.core.query.Paging;
import sk.adresa.eaukcia.core.service.AuctionService;
import sk.adresa.eaukcia.core.util.Assert;

/**
 *
 * @author juraj
 */
public class AuctionServiceImpl implements AuctionService {

    private AuctionDao auctionDao;

    public AuctionServiceImpl(AuctionDao auctionDao){
        Assert.isNotNull(auctionDao, "auctionDao");
        
        this.auctionDao = auctionDao;
    }

    @Override
    public Auction getAuction(int auctionId) {
        Assert.isNotNegativeOrZero(auctionId, "auctionId");
        return auctionDao.getAuction(auctionId);
    }

    @Override
    public PaginatedList<Auction> getFilteredAuctions(AuctionFilter filter, Paging paging) {
        Assert.isNotNull(paging, "paging");
        return auctionDao.getFilteredAuctions(filter, paging);
    }

}
